<script type="text/javascript" src="<?php echo Yii::app()->baseUrl ?>/scripts/jquery/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->baseUrl ?>/scripts/js/post/index.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        var status = '<? echo $pagevals['status']; ?>';
        $('#status').val(status);
        
        var vote = '<? echo $pagevals['vote']; ?>';
        $('#vote').val(vote);
        
        var position = '<? echo $pagevals['position']; ?>';
        $('#position').val(position);
        
        var hot_status = '<? echo $pagevals['hot_status']; ?>';
        $('#hot_status').val(hot_status);
        
        var author_id = '<? echo $pagevals['author_id']; ?>';
        $('#author_id').val(author_id);
        
        var category = '<? echo $pagevals['category_id']; ?>';
        $('#category_id').val(category);
        
        $('#search_box').keyup(function(e){
            var search_string =  $('#search_box').val();
            action = "?r=post/index&status="+status+"&vote="+vote+"&position="+position+"&hot_status="+hot_status+"&author_id="+author_id+"&search_string="+search_string+"&category_id="+category;
            if(e.keyCode == 13){
              window.location = action;
            }
        });
        
        $("#status").change(function(){
            var filter_laber_status = $("#status").val();
            action = "?r=post/index&status="+filter_laber_status+"&vote="+vote+"&position="+position+"&hot_status="+hot_status+"&author_id="+author_id+"&category_id="+category;
            window.location = action;
         });
         
         $("#vote").change(function(){
            var filter_laber_vote = $("#vote").val();
            action = "?r=post/index&status="+status+"&vote="+filter_laber_vote+"&position="+position+"&hot_status="+hot_status+"&author_id="+author_id+"&category_id="+category;
            window.location = action;
         });
         
         $("#position").change(function(){
            var filter_laber_position = $("#position").val();
            action = "?r=post/index&status="+status+"&vote="+vote+"&position="+filter_laber_position+"&hot_status="+hot_status+"&author_id="+author_id+"&category_id="+category;
            window.location = action;
         });
         
         $("#author_id").change(function(){
            var filter_laber_author_id = $("#author_id").val();
            action = "?r=post/index&status="+status+"&vote="+vote+"&position="+position+"&hot_status="+hot_status+"&author_id="+filter_laber_author_id+"&category_id="+category;
            window.location = action;
         });
         
         $("#category_id").change(function(){
            var filter_laber_category = $("#category_id").val();
            action = "?r=post/index&status="+status+"&vote="+vote+"&position="+position+"&hot_status="+hot_status+"&author_id="+author_id+"&category_id="+filter_laber_category;
            window.location = action;
         });
         
         $("#hot_status").change(function(){
            var filter_laber_hot_status = $("#hot_status").val();
            action = "?r=post/index&status="+status+"&vote="+vote+"&position="+position+"&hot_status="+filter_laber_hot_status+"&author_id="+author_id+"&category_id="+category;
            window.location = action;
         });
       
    });
</script>

<div style="float: left;">
   <button class="btn create_new" href="?r=post/create"><span class="icon16 cut-icon-plus"></span> Add</button>
   <?php
        $btn_pending='<button class="btn pending_checked" style="margin-right: 3px" href="#"><span class="icon16 entypo-icon-time"></span> Pending</button>';
        $btn_approve='<button class="btn approve_checked" style="margin-right: 3px" href="#"><span class="icon16 icomoon-icon-checkmark"></span> Approve</button>';
        $btn_active='<button class="btn active_checked" style="margin-right: 3px" href="#"><span class="icon16 icomoon-icon-arrow-up-7"></span> Active</button>';
        $btn_block='<button class="btn block_checked" style="margin-right: 3px" href="#"><span class="icon16 icomoon-icon-blocked"></span> Block</button>';
        $btn_restore='<button class="btn restore_checked" style="margin-right: 3px" href="#"><span class="icon16 entypo-icon-back"></span> Restore</button>';
        $btn_remove='<button class="btn remove_checked" style="margin-right: 3px" href="#"><span class="icon16 icomoon-icon-remove-2"></span> Delete</button>';
        
         if($pagevals['status'] == 'pending'){
            //$post_active ='<a href="#" style="display:none;float:left" title="Active" id="'.$post['id'].'" class="active"><span class="icon12 icomoon-icon-arrow-up-7"></span></a>';
            $btn_block='<button class="btn block_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-blocked"></span> Block</button>';
            $btn_pending='<button class="btn pending_checked" style="display:none" href="#"><span class="icon16 entypo-icon-time"></span> Pending</button>';
            $btn_restore='<button class="btn restore_checked" style="display:none" href="#"><span class="icon16 entypo-icon-back"></span> Restore</button>';
         }
         if($pagevals['status'] == 'approved'){
            $btn_block='<button class="btn block_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-blocked"></span> Block</button>';
            $btn_approve='<button class="btn approve_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-checkmark"></span> Approve</button>';
            $btn_restore='<button class="btn restore_checked" style="display:none" href="#"><span class="icon16 entypo-icon-back"></span> Restore</button>';
        }
         if($pagevals['status'] == 'active'){
            $btn_approve='<button class="btn approve_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-checkmark"></span> Approve</button>';
            $btn_active='<button class="btn active_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-arrow-up-7"></span> Active</button>';
            $btn_restore='<button class="btn restore_checked" style="display:none" href="#"><span class="icon16 entypo-icon-back"></span> Restore</button>';
        }
         if($pagevals['status'] == 'blocked'){
            $btn_approve='<button class="btn approve_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-checkmark"></span> Approve</button>';
            $btn_block='<button class="btn block_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-blocked"></span> Block</button>';
            $btn_restore='<button class="btn restore_checked" style="display:none" href="#"><span class="icon16 entypo-icon-back"></span> Restore</button>';
         }
         if($pagevals['status'] == 'deleted'){
             
            $btn_pending='<button class="btn pending_checked" style="display:none" href="#"><span class="icon16 entypo-icon-time"></span> Pending</button>';
            $btn_approve='<button class="btn approve_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-checkmark"></span> Approve</button>';
            $btn_active='<button class="btn active_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-arrow-up-7"></span> Active</button>';
            $btn_block='<button class="btn block_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-blocked"></span> Block</button>';
            $btn_remove='<button class="btn remove_checked" style="display:none"  href="#"><span class="icon16 icomoon-icon-remove-2"></span> Delete</button>';
        }
        $control_button = $btn_pending.$btn_approve.$btn_active.$btn_block.$btn_restore.$btn_remove;
        echo $control_button;
   ?>
</div>

<div class="pagination" style="float: right; ">
  <ul>
      <li><span class=""><b><? echo $pagevals['row_start'] ?></b>-<b><? echo $pagevals['row_end'] ?></b> of <b><? echo $pagevals['total_row'] ?></b></span></li>
     <? if($pagevals['page_number'] != 1 && $pagevals['total_row'] != 0){ 
         $prev_page = $pagevals['page_number']-1;
         echo '<li><a href="?r=post/index&page_number='.$prev_page.'&status='.$pagevals['status'].'&search_string='.$pagevals['search_string'].'&vote='.$pagevals['vote'].'&position='.$pagevals['position'].'&author_id='.$pagevals['author_id'].'&hot_status'.$pagevals['hot_status'].'&category_id='.$pagevals['category_id'].'"><span class="icon12 minia-icon-arrow-left-3"></span></a></li>'; 
        }?>
    <? if($pagevals['page_number'] != $pagevals['total_page'] && $pagevals['total_row'] !=0 ) {
        $next_page = $pagevals['page_number']+1;
        echo '<li><a href="?r=post/index&page_number='.$next_page.'&status='.$pagevals['status'].'&search_string='.$pagevals['search_string'].'&vote='.$pagevals['vote'].'&position='.$pagevals['position'].'&author_id='.$pagevals['author_id'].'&hot_status'.$pagevals['hot_status'].'&category_id='.$pagevals['category_id'].'"><span class="icon12 minia-icon-arrow-right-3"></span></a></li>'; 
        }?>
      
  </ul>
</div>
<div style="clear: both"></div>

<style type="">
    .filter-wrapper {
        margin-right: 7px;
        float: left;
        margin-bottom: 5px;
    }
    
    .filter-label {
        padding-left: 10px;
    }
    
</style>

<div class="row-fluid">

    <div class="span69">

        <div class="box">

            <div class="title">

                <h4 class="left">
                    <!--span class="icon16 brocco-icon-grid"></span--> 
                    <div class="filter-wrapper">
                        <label class="filter-label">Trạng thái</label>
                        <select id="status" style="opacity: 0;">
                            <option class="filter_label" value="pending">Pending</option>
                            <option class="filter_label" value="active">Active</option>
                            <option class="filter_label" value="approved">Approved</option>
                            <option class="filter_label" value="blocked">Blocked</option>
                            <option class="filter_label" value="deleted">Deleted</option>
                            <option class="filter_label" value="all">All</option>
                        </select>
                    </div>
                    <div class="filter-wrapper">
                        <label class="filter-label">Danh mục</label>
                        <select name="category_id" id="category_id" style="opacity: 0;">
                            <option class="filter_label" value="all">All</option>
                            <?
                               foreach($pagevals['filter_label']['category'] as $key=> $value){
                                   echo '<option class="filter_label" value="'.$key.'">'.ucfirst($value).'</option>';
                               }
                           ?>
                        </select>
                    </div>    
                    <div class="filter-wrapper">
                        <label class="filter-label">Điểm bình chọn</label>
                        <select id="vote" style="opacity: 0;">
                           <option class="filter_label" value="all">All</option>
                           <option class="filter_label" value="1">1</option>
                           <option class="filter_label" value="2">2</option>
                           <option class="filter_label" value="3">3</option>
                           <option class="filter_label" value="4">4</option>
                           <option class="filter_label" value="5">5</option>
                           
                       </select>
                    </div>
                    
                    <div class="filter-wrapper">
                        <label class="filter-label">Vị trí hiển thị</label>
                        <select name="position" id="position" style="opacity: 0;">
                            <option class="filter_label" value="all">All</option>
                            <option value="hot" selected="selected" >Hot</option>
                            <option value="new">New</option>
                            <option value="nomal">Nomal</option>
                            <option value="top">Top</option>
                            <option value="left">Left</option>
                            <option value="right">Right</option>
                        </select><br /><br />
                    </div>
                     <div class="filter-wrapper">
                        <label class="filter-label">Bài viết Hot</label>
                        <select name="hot_status" id="hot_status" style="opacity: 0;">
                            <option class="filter_label" value="all">All</option>
                            <option value="0">No</option>
                            <option value="1" selected="selected">Yes</option> 
                        </select>
                    </div>
                    <input type="text" id="search_box" name="search_string" value="" class="" placeholder="<? if($pagevals['search_string'] != '') echo $pagevals['search_string']; else echo 'Search here ...'?>" style="margin-top: 24px; width: 380px; padding: 5px;">
                    
                    <div class="filter-wrapper" style="float:left">
                        <label class="filter-label">Người tạo</label>
                        <select name="author_id" id="author_id" style="opacity: 0;">
                            <option class="filter_label" value="all">All</option>
                            <?
                               foreach($pagevals['filter_label']['author'] as $key=> $value){
                                   echo '<option class="filter_label" value="'.$key.'">'.ucfirst($value).'</option>';
                               }
                           ?>
                        </select>
                    </div>
                    
                    <span style="clear: left"></span>    
                    </h4>
                
                <a href="#" class="minimize" style="display: none;">Minimize</a>
                <div class="clearfix"></div>
            </div>
            
            <div class="content noPad">
                <table class="responsive table table-bordered" id="checkAll">
                    <thead>
                      <tr>
                        <th id="masterCh" class="ch">
                            <div class="checker" id="uniform-undefined">
                                <span><input type="checkbox" name="checkbox" value="all" class="styled" style="opacity: 0;"></span>
                            </div>
                        </th>
                        
                        <th>Tên bài viết</th>
                        <th>Người tạo</th>
                        <!--th>Giới thiệu</th-->
                        <th>Nguồn</th>
                        <th>Lượt xem</th>
                        <th>Vị trí</th>
                        <th>Bắt đầu</th>
                        <th>Kết thúc</th>
                        <th>Đánh giá</th>
                        <th>Xử lý</th>
                      </tr>
                    </thead>
                    <tbody>
                        <?php
                          if(count($data)==0 || $data==null){
                              echo '<h3><label>Không có kết quả nào được tìm thấy.</label></h3>';
                          }else{  
                            $_tr = "</tr>";
                            $td_ = "<td style=vertical-align:middle>";$_td = "</td>";

                            $postlist = "";
                            foreach ($data as $post) {
                                
                               $postlist .='<tr id="row'.$post['id'].'"><td class="chChildren"><input type="checkbox" id="checkbox" value="'.$post['id'].'" class="styled"  /></td>'; 
                               $temp = explode(" ", $post["title"]);
                               $display_title = null;
                               $len = count($temp);
                               if($len >=7) {$limit=7;}
                               else {$limit = $len;}
                               for($i=0; $i<$limit;$i++) {
                                   $display_title .= $temp[$i] . " ";
                               }
                               $post_source = str_replace('http://', '', $post["source"]);
                               $post_source = str_replace('https://', '', $post_source);
                               $post_source = str_replace('www.', '', $post_source);
                               $source = explode('/', $post_source);
                               
                               $postlist .= '<td width="90"><a href="#" title = "'.$post["title"].'">'.trim($display_title).'...</a>'.$_td;
                               $postlist .= $td_.$post["author"].$_td;
                               //$postlist .= $td_.$post["short_intro"].$_td;
                               $postlist .= $td_.$source[0].$_td;
                               $postlist .= $td_.$post["pageviews"].$_td;
                               $postlist .= $td_.$post["position"].$_td;
                               $postlist .= $td_.date('H',$post["start_time"]).'H '.date('i',$post["start_time"]).'P '.date('d',$post["start_time"]).'/'.date('m',$post["start_time"]).'/'.date('Y',$post["start_time"]).$_td;
                               $postlist .= $td_.date('H',$post["end_time"]).'H'.date('i',$post["end_time"]).'P '.date('d',$post["end_time"]).'/'.date('m',$post["end_time"]).'/'.date('Y',$post["end_time"]).$_td;
                               $postlist .= $td_.$post["vote"].$_td;
                               $postlist .= '<td id="td'.$post['id'].'" width="90" style="vertical-align:middle"><div class="controls center">';
                               
                               $post_pending ='<a href="#" title="Pending" id="'.$post['id'].'" style="display:block;float:left" class="pending"><span class="icon12 entypo-icon-time"></span></a>';
                               $post_approved ='<a href="#" title="Approve" id="'.$post['id'].'" style="display:block;float:left" class="approved"><span class="icon12  icomoon-icon-checkmark"></span></a>';
                               $post_active ='<a href="#" title="Active" id="'.$post['id'].'" style="display:block;float:left" class="active"><span class="icon12 icomoon-icon-arrow-up-7"></span></a>';
                               $post_block ='<a href="#" title="Block" id="'.$post['id'].'" style="display:block;float:left" class="block"><span class="icon12 icomoon-icon-blocked"></span></a>';   
                               $post_edit = '<a href="?r=post/edit&id='.$post['id'].'" style="display:block;float:left" title="Edit"><span class="icon12 icomoon-icon-pencil"></span></a>';
                               $post_restore ='<a href="#" title="Restore" id="'.$post['id'].'" style="display:block;float:left" class="restore"><span class="icon12 entypo-icon-back"></span></a>';
                               $post_remove ='<a href="#" id="'.$post['id'].'" style="display:block;float:left" class="remove" title="Remove" ><span class="icon12 icomoon-icon-remove"></span></a></div></td>'.$_tr;
                               
                               if($post['status'] == 'pending'){
                                  //$post_active ='<a href="#" style="display:none;float:left" title="Active" id="'.$post['id'].'" class="active"><span class="icon12 icomoon-icon-arrow-up-7"></span></a>';
                                  $post_block ='<a href="#" style="display:none;float:left" title="Block" id="'.$post['id'].'" class="block"><span class="icon12 icomoon-icon-blocked"></span></a>';   
                                  $post_pending ='<a href="#" style="display:none;float:left" title="Pending" id="'.$post['id'].'" class="pending"><span class="icon12 entypo-icon-time"></span></a>';
                                  $post_restore ='<a href="#" style="display:none;float:left" title="Restore" id="'.$post['id'].'" class="restore"><span class="icon12 entypo-icon-back"></span></a>';
                               }
                               if($post['status'] == 'approved'){
                                  $post_block ='<a href="#" style="display:none;float:left" title="Block" id="'.$post['id'].'" class="block"><span class="icon12 icomoon-icon-blocked"></span></a>';
                                  $post_approved ='<a href="#" style="display:none;float:left" title="Approve" id="'.$post['id'].'" class="approved"><span class="icon12  icomoon-icon-checkmark"></span></a>';
                                  $post_restore ='<a href="#" style="display:none;float:left" title="Restore" id="'.$post['id'].'" class="restore"><span class="icon12 entypo-icon-back"></span></a>';
                               }
                               if($post['status'] == 'active'){
                                   //$post_pending ='<a href="#" style="display:none;float:left" title="Pending" id="'.$post['id'].'" class="pending"><span class="icon12 entypo-icon-time"></span></a>';
                                   $post_approved ='<a href="#" style="display:none;float:left" title="Approve" id="'.$post['id'].'" class="approved"><span class="icon12  icomoon-icon-checkmark"></span></a>';
                                   $post_active ='<a href="#" style="display:none;float:left" title="Active" id="'.$post['id'].'" class="active"><span class="icon12 icomoon-icon-arrow-up-7"></span></a>';
                                   $post_restore ='<a href="#" style="display:none;float:left" title="Restore" id="'.$post['id'].'" class="restore"><span class="icon12 entypo-icon-back"></span></a>';
                               }
                               if($post['status'] == 'blocked'){
                                  $post_approved ='<a href="#" style="display:none;float:left" title="Approve" id="'.$post['id'].'" class="approved"><span class="icon12  icomoon-icon-checkmark"></span></a>';
                                  $post_block ='<a href="#" style="display:none;float:left" title="Block" id="'.$post['id'].'" class="block"><span class="icon12 icomoon-icon-blocked"></span></a>';
                                  $post_restore ='<a href="#" style="display:none;float:left" title="Restore" id="'.$post['id'].'" class="restore"><span class="icon12 entypo-icon-back"></span></a>';
                               }
                               if($post['status'] == 'deleted'){
                                   $post_edit = '<a href="?r=post/edit&id='.$post['id'].'" style="display:none;float:left" title="Edit"><span class="icon12 icomoon-icon-pencil"></span></a>';
                                   $post_pending ='<a href="#" style="display:none;float:left"  title="Pending" id="'.$post['id'].'" class="pending"><span class="icon12 entypo-icon-time"></span></a>';
                                   $post_approved ='<a href="#" style="display:none;float:left"  title="Approve" id="'.$post['id'].'" class="approved"><span class="icon12  icomoon-icon-checkmark"></span></a>';
                                   $post_active ='<a href="#" style="display:none;float:left"  title="Active" id="'.$post['id'].'" class="active"><span class="icon12 icomoon-icon-arrow-up-7"></span></a>';
                                   $post_block ='<a href="#" style="display:none;float:left"  title="Block" id="'.$post['id'].'" class="block"><span class="icon12 icomoon-icon-blocked"></span></a>';   
                                   $post_remove ='<a href="#" style="display:none;float:left" id="'.$post['id'].'" class="remove" title="Remove" ><span class="icon12 icomoon-icon-remove"></span></a></div></td>'.$_tr;
                               }
                               $postlist .= $post_pending.$post_approved.$post_active.$post_block.$post_restore.$post_edit.$post_remove;
                            }
                             $postlist .= $_tr;
                             echo $postlist;
                             
                          }
                        ?>
                                      
                    </tbody>
                </table>
            </div>

        </div><!-- End .box -->

    </div><!-- End .span6 -->

</div>


<div style="float: left;">
   <button class="btn create_new" href="?r=post/create"><span class="icon16 cut-icon-plus"></span> Add</button>
   <?php
   /*
        $btn_pending='<button class="btn pending_checked" style="" href="#"><span class="icon16 entypo-icon-time"></span> Pending</button>';
        $btn_approve='<button class="btn approve_checked" href="#"><span class="icon16 icomoon-icon-checkmark"></span> Approve</button>';
        $btn_active='<button class="btn active_checked" href="#"><span class="icon16 icomoon-icon-arrow-up-7"></span> Active</button>';
        $btn_block='<button class="btn block_checked" href="#"><span class="icon16 icomoon-icon-blocked"></span> Block</button>';
        $btn_restore='<button class="btn restore_checked" href="#"><span class="icon16 entypo-icon-back"></span> Restore</button>';
        $btn_remove='<button class="btn remove_checked" href="#"><span class="icon16 icomoon-icon-remove-2"></span> Delete</button>';
   */     
         if($pagevals['status'] == 'pending'){
            //$post_active ='<a href="#" style="display:none;float:left" title="Active" id="'.$post['id'].'" class="active"><span class="icon12 icomoon-icon-arrow-up-7"></span></a>';
            $btn_block='<button class="btn block_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-blocked"></span> Block</button>';
            $btn_pending='<button class="btn pending_checked" style="display:none" href="#"><span class="icon16 entypo-icon-time"></span> Pending</button>';
            $btn_restore='<button class="btn restore_checked" style="display:none" href="#"><span class="icon16 entypo-icon-back"></span> Restore</button>';
         }
         if($pagevals['status'] == 'approved'){
            $btn_block='<button class="btn block_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-blocked"></span> Block</button>';
            $btn_approve='<button class="btn approve_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-checkmark"></span> Approve</button>';
            $btn_restore='<button class="btn restore_checked" style="display:none" href="#"><span class="icon16 entypo-icon-back"></span> Restore</button>';
        }
         if($pagevals['status'] == 'active'){
            $btn_approve='<button class="btn approve_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-checkmark"></span> Approve</button>';
            $btn_active='<button class="btn active_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-arrow-up-7"></span> Active</button>';
            $btn_restore='<button class="btn restore_checked" style="display:none" href="#"><span class="icon16 entypo-icon-back"></span> Restore</button>';
        }
         if($pagevals['status'] == 'blocked'){
            $btn_approve='<button class="btn approve_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-checkmark"></span> Approve</button>';
            $btn_block='<button class="btn block_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-blocked"></span> Block</button>';
            $btn_restore='<button class="btn restore_checked" style="display:none" href="#"><span class="icon16 entypo-icon-back"></span> Restore</button>';
         }
         if($pagevals['status'] == 'deleted'){
             
            $btn_pending='<button class="btn pending_checked" style="display:none" href="#"><span class="icon16 entypo-icon-time"></span> Pending</button>';
            $btn_approve='<button class="btn approve_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-checkmark"></span> Approve</button>';
            $btn_active='<button class="btn active_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-arrow-up-7"></span> Active</button>';
            $btn_block='<button class="btn block_checked" style="display:none" href="#"><span class="icon16 icomoon-icon-blocked"></span> Block</button>';
            $btn_remove='<button class="btn remove_checked" style="display:none"  href="#"><span class="icon16 icomoon-icon-remove-2"></span> Delete</button>';
        }
        $control_button = $btn_pending.$btn_approve.$btn_active.$btn_block.$btn_restore.$btn_remove;
        echo $control_button;
   ?>
</div>

<div class="pagination" style="float: right; ">
  <ul>
      <li><span class=""><b><? echo $pagevals['row_start'] ?></b>-<b><? echo $pagevals['row_end'] ?></b> of <b><? echo $pagevals['total_row'] ?></b></span></li>
    <? if($pagevals['page_number'] != 1 && $pagevals['total_row'] != 0){ 
         $prev_page = $pagevals['page_number']-1;
         echo '<li><a href="?r=post/index&page_number='.$prev_page.'&status='.$pagevals['status'].'&search_string='.$pagevals['search_string'].'&vote='.$pagevals['vote'].'&position='.$pagevals['position'].'&author_id='.$pagevals['author_id'].'&hot_status'.$pagevals['hot_status'].'&category_id='.$pagevals['category_id'].'"><span class="icon12 minia-icon-arrow-left-3"></span></a></li>'; 
        }?>
    <? if($pagevals['page_number'] != $pagevals['total_page'] && $pagevals['total_row'] !=0 ) {
        $next_page = $pagevals['page_number']+1;
        echo '<li><a href="?r=post/index&page_number='.$next_page.'&status='.$pagevals['status'].'&search_string='.$pagevals['search_string'].'&vote='.$pagevals['vote'].'&position='.$pagevals['position'].'&author_id='.$pagevals['author_id'].'&hot_status'.$pagevals['hot_status'].'&category_id='.$pagevals['category_id'].'"><span class="icon12 minia-icon-arrow-right-3"></span></a></li>'; 
        }?>
  </ul>
</div>
<div style="clear: both"></div>
